﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace server.filters
{
    public class StringEncoder : NetFilter
    {
        public void invoke(object buffer, InvocationChain invocationChain)
        {
            if (buffer is string)
            {
                invocationChain.invoke(Encoding.UTF8.GetBytes(buffer.ToString()));
            }
            else {

                invocationChain.invoke(buffer);
            }
        }
    }
}
